package server

import "sync"

func AutomaticAdd(num int) int32 {
	wg := sync.WaitGroup{}
	var ret int32
	for i := 0; i < num; i++ {
		go func(in *int32, wg *sync.WaitGroup) {
			wg.Add(1)
			defer wg.Done()
			// 累加操作
			ret++
		}(&ret, &wg)
	}
	return ret
}